
/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2012原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.aop.scope;

import org.springframework.aop.RawTargetAccess;

/**
 * An AOP introduction interface for scoped objects.
 *
 * <p>Objects created from the {@link ScopedProxyFactoryBean} can be cast
 * to this interface, enabling access to the raw target object
 * and programmatic removal of the target object.
 *
 * @author Rod Johnson
 * @author Juergen Hoeller
 * @since 2.0
 * @see ScopedProxyFactoryBean
 */
/**
 *作用域对象的AOP引入接口。
 *
 *＜p＞可以强制转换从｛@link ScopedProxyFactoryBean｝创建的对象
 *此接口，允许访问原始目标对象
 *以及目标对象的编程移除。
 *
 *@作者Rod Johnson
 *@作者Juergen Hoeller
 *@自2.0起
 *@参见ScopedProxyFactoryBean
 */
public interface ScopedObject extends RawTargetAccess {

	/**
	 * Return the current target object behind this scoped object proxy,
	 * in its raw form (as stored in the target scope).
	 * <p>The raw target object can for example be passed to persistence
	 * providers which would not be able to handle the scoped proxy object.
	 * @return the current target object behind this scoped object proxy
	 */
	/**
	 *返回此作用域对象代理后面的当前目标对象，
	 *以其原始形式（存储在目标范围中）。
	 *＜p＞例如，原始目标对象可以传递给持久性
	 *无法处理作用域代理对象的提供程序。
	 *@返回此作用域对象代理后面的当前目标对象
	 */
	Object getTargetObject();

	/**
	 * Remove this object from its target scope, for example from
	 * the backing session.
	 * <p>Note that no further calls may be made to the scoped object
	 * afterwards (at least within the current thread, that is, with
	 * the exact same target object in the target scope).
	 */
	/**
	 *从其目标范围中删除此对象，例如从
	 *支持会话。
	 *＜p＞注意，不能对作用域对象进行进一步调用
	 *之后（至少在当前线程内，即
	 *目标范围中完全相同的目标对象）。
	 */
	void removeFromScope();

}
